package com.tapstitch.scm.pms.web.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class RedissonConfig {

    @Value("${spring.redis.host}")
    private String host;
    @Value("${spring.redis.port}")
    private int port;
    @Value("${spring.redis.timeout:3000}")
    private int timeout;
    @Value("${spring.redis.password:}")
    private String password;
    @Value("${spring.redis.database}")
    private int database;

//    @Bean(destroyMethod = "shutdown")
//    public RedissonClient redissonClient() {
//        // 1、创建配置
//        Config config = new Config();
//        config.useSingleServer()
//                .setAddress("redis://"+host+":"+port)
//                .setPassword(password)
//                .setDatabase(database);

//        return Redisson.create(config);
//    }
}
